<?php

/**
 * Application bootstarp class. For setting stuff up what the application needs.
 * 
 * @package disputeo
 * @version 1.0
 * @author jimmy.dixon
 */
class Bootstrap extends Zend_Application_Bootstrap_Bootstrap
{

    /**
     * Set the HTML doc type
     */
    protected function _initDoctype()
    {
        $this->bootstrap('view');
        $view = $this->getResource('view');
        $view->doctype('XHTML1_STRICT');
    }

    /**
     * Specify helpers directories
     */
    protected function _initHelperPath()
    {
        $helpers = APPLICATION_PATH . '/layouts/helpers';
        $jquery = 'ZendX/JQuery/View/Helper/';
        $view = $this->getResource('view');
        $view->addHelperPath($helpers, 'Zend_View_Helper')
            ->addHelperPath($jquery, 'ZendX_JQuery_View_Helper');
    }

    /**
     * Specify namespace for library classes
     */
    protected function _initNameSpace()
    {
        $autoloader = Zend_Loader_Autoloader::getInstance();
        $autoloader->registerNamespace('Disputeo');
    }

    /**
     * Register application plugins
     */
    protected function _initPlugins()
    {
        $front = Zend_Controller_Front::getInstance();
        $front->registerPlugin(new Disputeo_Controller_Plugin_Init());
    }

    /**
     * Register application helpers
     */
    protected function _initHelpers()
    {
        Zend_Controller_Action_HelperBroker::addHelper(new Disputeo_Controller_Helper_Init());
        Zend_Controller_Action_HelperBroker::addHelper(new Disputeo_Controller_Helper_FormCheck());
    }

}

